package com.foreknow.exer8;

/**
 * @author shkstart
 * @create 2021-07-26 17:43
 */
public class Computer {
      String name;
    int csort;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCsort() {
        return csort;
    }

    public void setCsort(int csort) {
        this.csort = csort;
    }
    public int showFist(){
        // 产生随机数
        int show = (int)(Math.random()*10)%3 + 1;  //产生随机数，表示电脑出拳

        // 输出出拳结果并返回
        switch(show){
            case 1:
                System.out.println(name+"出拳: 剪刀");
                break;
            case 2:
                System.out.println(name+"出拳: 石头");
                break;
            case 3:
                System.out.println(name+"出拳: 布");
                break;
        }
        return show;
    }
}
